package _18_剑指OfferII;

import _18_剑指OfferII.datastrcute.TreeNode;

public class _047_剑指OfferII二叉树剪枝 {

    public TreeNode pruneTree(TreeNode root) {
        if (root == null) return null;

        root.left = pruneTree(root.left);
        root.right = pruneTree(root.right);
        return root.left == null && root.right == null && root.val == 0? null: root;
    }

}

